<?php

use think\facade\Route;


//商品分类
Route::group('productCate', function () {
    $graft = '\addons\V2\admin\controller\ProductCate@';
    Route::get('/index', $graft . 'index');
    Route::get('/add', $graft . 'add');
    Route::get('/edit', $graft . 'edit');
    Route::get('/getCate', $graft . 'getCate');
    Route::post('/save', $graft . 'save');
    Route::post('/update', $graft . 'update');
})->middleware('verify');

//商品规格
Route::group('spec', function () {
    $graft = '\addons\V2\admin\controller\Spec@';
    Route::get('/index', $graft . 'index');
    Route::get('/getList', $graft . 'getList');
    Route::get('/add', $graft . 'add');
    Route::get('/edit', $graft . 'edit');
    Route::get('/getSpec', $graft . 'getSpec');
    Route::post('/save', $graft . 'save');
    Route::rule('/update', $graft . 'update');
    Route::post('/delete', $graft . 'delete');
})->middleware('verify');

//商品列表
Route::group('product', function () {
    $graft = '\addons\V2\admin\controller\Product@';
    Route::get('/index', $graft . 'index');
    Route::get('/getList', $graft . 'getList');
    Route::get('/add', $graft . 'add');
    Route::get('/edit', $graft . 'edit');
    Route::post('/save', $graft . 'save');
    Route::rule('/update', $graft . 'update');
    Route::post('/delete', $graft . 'delete');
})->middleware('verify');

Route::group('hypermarket', function () {
    $graft = '\addons\V2\admin\controller\Hypermarket@';
    Route::get('/index', $graft . 'index');
    Route::get('/getList', $graft . 'getList');
    Route::get('/add', $graft . 'add');
    Route::get('/edit', $graft . 'edit');
    Route::post('/save', $graft . 'save');
    Route::rule('/update', $graft . 'update');
    Route::post('/delete', $graft . 'delete');
})->middleware('verify');

//订单管理
Route::group('order', function () {
    $graft = '\addons\V2\admin\controller\Order@';
    Route::get('/index', $graft . 'index');
    Route::get('/spec', $graft . 'spec');
    Route::get('/getList', $graft . 'getList');
    Route::get('/add', $graft . 'add');
    Route::get('/edit', $graft . 'edit');
    Route::get('/export', $graft . 'export');
    Route::get('/getArea', $graft . 'getArea');
    Route::post('/save', $graft . 'save');
    Route::post('/update', $graft . 'update');
    Route::post('/delete', $graft . 'delete');
    Route::rule('/deliver', $graft . 'deliver');
})->middleware('verify');

